<?php /* Smarty version 2.6.18, created on 2009-09-30 05:27:17
         compiled from editstaff.tpl */ ?>
<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
smarty_core_load_plugins(array('plugins' => array(array('modifier', 'date_format', 'editstaff.tpl', 88, false),)), $this); ?>
<div id="blanket" style="display:none;"></div>
<div id="editAddress" style="background-color:#fff;width:500px;z-index: 1002;display:none;position: absolute;">
</div>
<div id="editContact" style="background-color:#fff;width:500px;z-index: 1002;display:none;position: absolute;">
</div>
<script type="text/javascript">	
	var da = new ekimo_drag_region("content","editAddress");
	var dc = new ekimo_drag_region("content","editContact");
	<?php echo '
		Calendar.setup({
	        inputField     :    "cal[date_hired]",     // id of the input field
	        ifFormat       :    "%Y-%m-%d" ,    // format of the input field
	        displayArea    :    "date_hired",
	        daFormat       :    "%Y-%m-%d",      // format of the display area
	        button         :    "f_trigger_c1",  // trigger for the calendar (button ID)
	        align          :    "Bl",           // alignment (defaults to "Bl")
	        singleClick    :    true,
			//onUpdate	   :    endDateChanged, //event to call after calendar is closed
	        weekNumbers    :    false,
	        zIndex		   :	2000
	    });
		Calendar.setup({
	        inputField     :    "cal[date_resigned]",     // id of the input field
	        ifFormat       :    "%Y-%m-%d" ,    // format of the input field
	        displayArea    :    "date_resigned",
	        daFormat       :    "%Y-%m-%d",      // format of the display area
	        button         :    "f_trigger_c2",  // trigger for the calendar (button ID)
	        align          :    "Bl",           // alignment (defaults to "Bl")
	        singleClick    :    true,
			//onUpdate	   :    endDateChanged, //event to call after calendar is closed
	        weekNumbers    :    false,
	        zIndex		   :	2000
	    });	
	    Calendar.setup({
	        inputField     :    "cal[date_birth]",     // id of the input field
	        ifFormat       :    "%Y-%m-%d" ,    // format of the input field
	        displayArea    :    "date_birth",
	        daFormat       :    "%Y-%m-%d",      // format of the display area
	        button         :    "f_trigger_c3",  // trigger for the calendar (button ID)
	        align          :    "Bl",           // alignment (defaults to "Bl")
	        singleClick    :    true,
			//onUpdate	   :    endDateChanged, //event to call after calendar is closed
	        weekNumbers    :    false,
	        zIndex		   :	2000
	    });					    
	'; ?>

</script>
<form name="mainForm" method="POST" id="mainForm" enctype="multipart/form-data">
<input type="hidden" name="user[staff_id]" value="<?php echo $this->_tpl_vars['id']; ?>
">	
<input type="hidden" value="<?php echo $this->_tpl_vars['uploadDir']; ?>
/<?php echo $this->_tpl_vars['photo']['link']; ?>
">
	<h1>Staff Information</h1>
	<div id="result" style="float: left; width: 100%;">
		<table border="0" style="width: 100%">
			<tr>
				<td>Staff No.</td>
				<td><input type="text" name="user[identification_no]" value="<?php echo $this->_tpl_vars['staff']['identification_no']; ?>
" size="10"></td>
                <td rowspan="14" style="padding-right: 20px; vertical-align: top; padding-top: 20px;
                    text-align: right">
        <table>
            <tr>
                <td colspan="2" style="text-align: center;" nowrap="1">
                    <img width="150" height="120" src="http://<?php echo $this->_tpl_vars['uploadDir']; ?>
/<?php echo $this->_tpl_vars['photo']['link']; ?>
" alt="No Image"/>
                </td>
            </tr>
        </table>
                </td>
			</tr>
			<tr>
				<td nowrap>First Name:</td>
				<td><input type="text" name="user[first_name]" value="<?php echo $this->_tpl_vars['staff']['first_name']; ?>
" size="20"></td>
			</tr>
			<tr>
				<td nowrap>Middle Name:</td>
				<td><input type="text" name="user[middle_name]" value="<?php echo $this->_tpl_vars['staff']['middle_name']; ?>
" size="20"></td>
			</tr>
			<tr>
				<td nowrap>Last Name:</td>
				<td><input type="text" name="user[last_name]" value="<?php echo $this->_tpl_vars['staff']['last_name']; ?>
" size="20"></td>
			</tr>
			<tr>
				<td>Position:</td>
				<td><input type="text" name="user[position]" value="<?php echo $this->_tpl_vars['staff']['position']; ?>
" size="20"></td>
			</tr>
			<tr>
				<td>Date Hired:</td>
				<!-- <td><input type="text" name="user[date_hired]" value="<?php echo $this->_tpl_vars['staff']['date_hired']; ?>
" size="10"></td> -->
				<td>
					<input style="float:left" type="hidden" name="user[date_hired]" id="cal[date_hired]" value="<?php echo ((is_array($_tmp=$this->_tpl_vars['staff']['date_hired'])) ? $this->_run_mod_handler('date_format', true, $_tmp, "%Y-%m-%d") : smarty_modifier_date_format($_tmp, "%Y-%m-%d")); ?>
" size="10"> 
					<span id="date_hired"  style="width:80px; display:block; float:left; height:15px; text-align:center;"><?php echo ((is_array($_tmp=$this->_tpl_vars['staff']['date_hired'])) ? $this->_run_mod_handler('date_format', true, $_tmp, "%Y-%m-%d") : smarty_modifier_date_format($_tmp, "%Y-%m-%d")); ?>
</span>				
					<input style="float:left" type="image" src="/app/default/www/images/calendar.jpg" align="absmiddle" id="f_trigger_c1" style="cursor: pointer; border: 0px ;" title="Date selector"/>
					<input type="hidden" name="dateYui" value="cal[date_hired]/date_hired/f_trigger_c1">
				</td>
			</tr>
			<tr>
				<td>Date Resigned:</td>
				<!-- <td><input type="text" name="user[date_resigned]" value="<?php echo $this->_tpl_vars['staff']['date_resigned']; ?>
" size="10"></td> -->
				<td>
					<input style="float:left" type="hidden" name="user[date_resigned]" id="cal[date_resigned]" value="<?php echo ((is_array($_tmp=$this->_tpl_vars['staff']['date_resigned'])) ? $this->_run_mod_handler('date_format', true, $_tmp, "%Y-%m-%d") : smarty_modifier_date_format($_tmp, "%Y-%m-%d")); ?>
" size="10"> 
					<span id="date_resigned"  style="width:80px; display:block; float:left; height:15px; text-align:center;"><?php echo ((is_array($_tmp=$this->_tpl_vars['staff']['date_resigned'])) ? $this->_run_mod_handler('date_format', true, $_tmp, "%Y-%m-%d") : smarty_modifier_date_format($_tmp, "%Y-%m-%d")); ?>
</span>				
					<input style="float:left" type="image" src="/app/default/www/images/calendar.jpg" align="absmiddle" id="f_trigger_c2" style="cursor: pointer; border: 0px ;" title="Date selector"/>
					<input type="hidden" name="dateYui" value="cal[date_resigned]/date_resigned/f_trigger_c2">
				</td>
			</tr>
			<tr>
				<td>Email:</td>
				<td><input type="text" name="user[email]" value="<?php echo $this->_tpl_vars['staff']['email']; ?>
" size="40"></td>
			</tr>
			<tr>
				<td>Gender:</td>
				<td><select name="user[gender]">
					<option value="Male" <?php if ($this->_tpl_vars['staff']['gender'] == 'Male'): ?> selected <?php endif; ?>>Male</option>
					<option value="Female" <?php if ($this->_tpl_vars['staff']['gender'] == 'Female'): ?> selected <?php endif; ?>>Female</option>
				</select></td>
			</tr>
			<tr>
				<td>Date of Birth:</td>
				<!-- <td><input type="text" name="user[date_birth]" value="<?php echo $this->_tpl_vars['staff']['date_birth']; ?>
" size="10"></td> -->
				<td>
					<input style="float:left" type="hidden" name="user[date_birth]" id="cal[date_birth]" value="<?php echo ((is_array($_tmp=$this->_tpl_vars['staff']['date_birth'])) ? $this->_run_mod_handler('date_format', true, $_tmp, "%Y-%m-%d") : smarty_modifier_date_format($_tmp, "%Y-%m-%d")); ?>
" size="10"> 
					<span id="date_birth"  style="width:80px; display:block; float:left; height:15px; text-align:center;"><?php echo ((is_array($_tmp=$this->_tpl_vars['staff']['date_birth'])) ? $this->_run_mod_handler('date_format', true, $_tmp, "%Y-%m-%d") : smarty_modifier_date_format($_tmp, "%Y-%m-%d")); ?>
</span>				
					<input style="float:left" type="image" src="/app/default/www/images/calendar.jpg" align="absmiddle" id="f_trigger_c3" style="cursor: pointer; border: 0px ;" title="Date selector"/>
					<input type="hidden" name="dateYui" value="cal[date_birth]/date_birth/f_trigger_c3">
				</td>
			</tr>
            <tr>
                <td>
                    Remarks:</td>
                <td>
                    <input type="text" name="user[remarks]" value="<?php echo $this->_tpl_vars['staff']['remarks']; ?>
" size="100"></td>
            </tr>
            <tr>
                <td>
                    Current Address:</td>
                <td>
                <?php echo $this->_tpl_vars['address']['address']; ?>

                </td>
            </tr>
            <tr>
                <td>
                    Phone:</td>
                <td>
                <?php echo $this->_tpl_vars['contact']['telephone_no']; ?>

                </td>
            </tr>
            <tr>
                <td>
                    Email:</td>
                <td>
                <?php echo $this->_tpl_vars['contact']['email']; ?>

                </td>
            </tr>
            <tr>
                <td colspan="3" style="border-top-width: 1px; border-top-color: navy; padding-top: 10px;
                    height: 26px; text-align: right">
                </td>
            </tr>
            <tr>
                <td colspan="3" style="text-align: right; height: 26px; border-top: navy 1px solid; padding-top: 20px;">
					<!-- <input type="hidden" name="hid" value="<?php echo $this->_tpl_vars['staff']['photo_document_id']; ?>
"> -->
                    Select an image: <input id="loadFile" type="file" name="uploadFile">&nbsp;&nbsp;&nbsp;
					<?php if ($this->_tpl_vars['staff']['staff_id'] == 0): ?>
						<input type="button" value="Create" onclick="saveStaff();">
					<?php else: ?>
						<input type="button" value="Address..." onclick="editAddress('<?php echo $this->_tpl_vars['staff']['address_id']; ?>
','<?php echo $this->_tpl_vars['staff']['staff_id']; ?>
');">							
						<input type="button" value="Contact..." onclick="editContact('<?php echo $this->_tpl_vars['staff']['contact_id']; ?>
','<?php echo $this->_tpl_vars['staff']['staff_id']; ?>
');">					
						<input type="button" value="Save" onclick="saveStaff();">
						<!-- <input type="submit" value="Save"> -->
					<?php endif; ?>
					<input type="button" value="Cancel" onclick="cancel();">		
				</td>
            </tr>
		</table>
	</div> 
    <!-- results -->

</form>
<script language="javascript">
<?php echo '
	function cancel(){
		doajaxAction("/account/orgStaffs",0,"main_content");
	}
	function saveStaff(){
		doajaxAction("/account/saveStaff/fromSave/1",1,"main_content",document.getElementById(\'mainForm\'),false,true);
	}
	function editAddress(addressId,staffId){
		doajaxAction("/account/getStaffAddress/addressId/"+addressId+"/staffId/"+staffId,0,\'editAddress\');
		popup("editAddress");
	}
	function editContact(contactId){
		doajaxAction("/account/getStaffContact/contactId/"+contactId+"/staffId/"+staffId,0,\'editContact\');
		popup("editContact");
	}
'; ?>

</script>
            
            